﻿using System.Windows;
using System.Windows.Controls;

namespace Calculator
{
    public partial class UnitConversionControl : UserControl
    {
        public UnitConversionControl()
        {
            InitializeComponent();
        }

        private void lenthButton_clicked(object sender, RoutedEventArgs e)
        {
            // 创建 LenthConvert 实例
            var lengthConvertControl = new LenthConvert()
            {                            
                HorizontalAlignment = HorizontalAlignment.Stretch,
                VerticalAlignment = VerticalAlignment.Stretch
            };
      

            // 将其加载到右侧 ContentControl
            RightContent.Content = lengthConvertControl;
        }

        private void AreaButton_Click(object sender, RoutedEventArgs e)
        {
            // 创建 AreaConvert 控件的实例
            var areaConvertControl = new AreaConvert
            {
                HorizontalAlignment = HorizontalAlignment.Stretch,
                VerticalAlignment = VerticalAlignment.Stretch
            };

            // 将 AreaConvert 加载到 RightContent
            RightContent.Content = areaConvertControl;
        }
    }
}
